{% extends 'index.html' %}
{% load static %}

{% block css %}
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-datepicker.min.css' %}">
{% endblock %}

{% block content %}
    <div class="container">
        <div class="panel panel-default">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"> 新建部门</h3>
                </div>
                <div class="panel-body">
                    <form method="post">
                        {% csrf_token %}
                        <div class="form-group">
                            <label>姓 名</label>
                            <label>
                                <input type="text" class="form-control" name="name" placeholder="请输入姓名"
                                       style="margin-left: 25px"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label>密 码</label>
                            <label>
                                <input type="text" class="form-control" name="pwd" placeholder="请输入密码"
                                       style="margin-left: 25px"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label>年 龄</label>
                            <label>
                                <input type="text" class="form-control" name="age" placeholder="请输入年龄"
                                       style="margin-left: 25px"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label>余 额</label>
                            <label>
                                <input type="text" class="form-control" name="account" placeholder="请输入余额"
                                       style="margin-left: 25px"/>
                            </label>
                        </div>
                        <div class="form-group">
                            <label>入职时间</label>
                            <label style=";width: 220px;">
                                <input id="create_time" type="text" class="form-control" name="create_time"
                                       placeholder="请输入入职时间"
                                       style="margin-left: 5px;width: 240px;"/>
                            </label>
                        </div>

                        <div class="form-group">
                            <label>性 别</label>
                            <label>
                                <select class="form-control" style="width: 240px;margin-left: 25px" name="gender">
                                    {% for item in gender_choices %}
                                        <option value="{{ item.0 }}">{{ item.1 }}</option>
                                    {% endfor %}
                                </select>
                            </label>
                        </div>
                        <div class="form-group">
                            <label>所属部门</label>
                            <label>
                                <select class="form-control" name="rolename" style="width: 240px;margin-left: 5px">
                                    {% for item in department_list %}
                                        <option value="{{ item.id }}">{{ item.rolename }}</option>
                                    {% endfor %}
                                </select>
                            </label>

                        </div>


                        <button type="submit" class="btn btn-primary">提 交</button>
                    </form>

                </div>
            </div>
        </div>
    </div>

{% endblock %}
{% block js %}
    <script src="{% static 'plugins/bootstrap-datepicker.zh-CN.min.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-datepicker.js' %}"></script>

    <script>
        $(function () {
            $('#create_time').datepicker({
                format: 'yyyy-mm-dd',
                startDate: '0',
                language: 'zh-Cn',
                autoclose: true
            })
        })
    </script>

{% endblock %}

